package com.weaver.drools.business.execution.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.weaver.drools.business.execution.service.IEAqInsReviewrectify128Service;
import com.weaver.drools.common.dao.EAqInsReviewrectify128Dao;
import com.weaver.drools.common.entity.EAqInsReviewrectify128;
@Service
public class EAqInsReviewrectify128ServiceImpl implements IEAqInsReviewrectify128Service {

	@Autowired
	private EAqInsReviewrectify128Dao EAqInsReviewrectify128Dao;
	@Override
	public EAqInsReviewrectify128 findById(Long reviewrectifyid) {
		// TODO Auto-generated method stub
		return EAqInsReviewrectify128Dao.findEAqInsReviewrectify128ByReviewrectifyid(reviewrectifyid);
	}

	@Override
	public void saveEAqInsReviewrectify128(EAqInsReviewrectify128 reviewrectify128) {
		EAqInsReviewrectify128Dao.saveOrUpdate(reviewrectify128);
	}

	@Override
	public void updateEAqInsReviewrectify128(EAqInsReviewrectify128 reviewrectify128) {
		EAqInsReviewrectify128Dao.saveOrUpdate(reviewrectify128);
	}

	@Override
	public void deleteById(Long reviewrectifyid) {
		EAqInsReviewrectify128Dao.deleteById(reviewrectifyid);
	}

	@Override
	public EAqInsReviewrectify128 findLastBeanByInpectionPandectId(String inpectionPandectId) throws Exception {
		String hql="from EAqInsReviewrectify128 where isdeleted=0 and rownum=1";
		if(inpectionPandectId!=null && !inpectionPandectId.equals("")){
			hql+=" and EAqInsReview125.EAqInsInpectionpandect599.inpectionpandectid="+inpectionPandectId;
		}
		hql+=" order by reviewrectifyid desc";
		return EAqInsReviewrectify128Dao.findEntity(hql);
	}

}
